void main() {
  List list = [
    {"name": '夏庆鹏'},
    {"name": '黄磊'},
    {"name": '李豪'},
    {"name": '张三'},
    {"name": '李四'},
  ];

  // for循环
  for (int i = 0; i < list.length; i++) {
    print(list[i]['name']);
  }

  // for in 循环
  for (var item in list) {
    print(item['name']);
    print(list.indexOf(item));
    print('+++++++++++++++++++');
  }

  // map 循环

  var list1 = list.map((item) {
    return {"name": item["name"], "index": list.indexOf(item)};
  });
  print(list1.toList());

  //  forEach 循环

  var newList = list.forEach((element) {
    print('元素为:${element}');
  });

  //  where条件查询

  List list2 = [
    {"name": '夏庆鹏', "age": 18},
    {"name": '黄磊', "age": 22},
    {"name": '李豪', "age": 24},
    {"name": '张三', "age": 28},
    {"name": '李四', "age": 40},
  ];
  var list3 = list2.where((element) {
    return element["age"] > 25;
  });
  print(list3);

  // 判断集合条件都满足返回true,否则返回false

  final bool bool1 = list2.every((element) => element['age'] > 20);
  print(bool1);

  // 判断集合有条件满足返回true,否则返回false

  final bool bool2 = list2.any((element) => element['age'] > 35);
  print(bool2);

  // list 去重
  var list10 = [1, 2, 3, 4, 2, 3, 4, 4];
  print(list10.toSet().toList());


  var  4
}
